'use strict'


module.exports = app => {
    const mongoose = app.mongoose
    const Schema = mongoose.Schema
    const ObjectId = Schema.Types.ObjectId
    const LeaveMessageSchema = new Schema({
        user_id:{
            type:ObjectId,
            ref:'User'
        },
        create_time:{
            type:Date,
            default:Date.now
        },
        content:{
            type:String
        },
        like_count:{
            type:Number,
            default:0
        },
        like_id:{
            type:[ObjectId],
            default:[]
        }
    },{ versionKey:false })

    return mongoose.model('LeaveMessage',LeaveMessageSchema,'LeaveMessage')
}
